home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / lang / fpc09905c.lha / fpc / inc / exec.inc < prev    next >
Text File  |  1998-09-21  |  35KB  |  1,050 lines

  1. TYPE
  2.  
  3.        STRPTR   = PChar;
  4.        ULONG    = Longint;
  5.        LONG     = longint;
  6.        APTR     = Pointer;
  7.        BPTR     = Longint;
  8.        BSTR     = Longint;
  9.        pWord    = ^Word;
  10.        pLongint = ^Longint;
  11.        pInteger = ^Integer;
  12.  
  13.  
  14. TYPE
  15.  
  16. { *  List Node Structure.  Each member in a list starts with a Node * }
  17.  
  18.   pNode = ^tNode;
  19.   tNode = Packed Record
  20.     ln_Succ,                { * Pointer to next (successor) * }
  21.     ln_Pred  : pNode;       { * Pointer to previous (predecessor) * }
  22.     ln_Type  : Byte;
  23.     ln_Pri   : Shortint;        { * Priority, for sorting * }
  24.     ln_Name  : STRPTR;      { * ID string, null terminated * }
  25.   End;  { * Note: Integer aligned * }
  26.  
  27.  
  28. { * minimal node -- no type checking possible * }
  29.  
  30.   pMinNode = ^tMinNode;
  31.   tMinNode = Packed Record
  32.     mln_Succ,
  33.     mln_Pred  : pMinNode;
  34.   End;
  35.  
  36.  
  37.  
  38. { *
  39. ** Note: Newly initialized IORequests, and software interrupt structures
  40. ** used with Cause(), should have type NT_UNKNOWN.  The OS will assign a type
  41. ** when they are first used.
  42. * }
  43.  
  44. { *----- Node Types for LN_TYPE -----* }
  45.  
  46. Const
  47.  
  48.   NT_UNKNOWN      =  0;
  49.   NT_TASK     =  1;  { * Exec task * }
  50.   NT_INTERRUPT    =  2;
  51.   NT_DEVICE   =  3;
  52.   NT_MSGPORT      =  4;
  53.   NT_MESSAGE      =  5;  { * Indicates message currently pending * }
  54.   NT_FREEMSG      =  6;
  55.   NT_REPLYMSG     =  7;  { * Message has been replied * }
  56.   NT_RESOURCE     =  8;
  57.   NT_LIBRARY      =  9;
  58.   NT_MEMORY   = 10;
  59.   NT_SOFTINT      = 11;  { * Internal flag used by SoftInits * }
  60.   NT_FONT     = 12;
  61.   NT_PROCESS      = 13;  { * AmigaDOS Process * }
  62.   NT_SEMAPHORE    = 14;
  63.   NT_SIGNALSEM    = 15;  { * signal semaphores * }
  64.   NT_BOOTNODE     = 16;
  65.   NT_KICKMEM      = 17;
  66.   NT_GRAPHICS     = 18;
  67.   NT_DEATHMESSAGE = 19;
  68.  
  69.   NT_USER     = 254;  { * User node types work down from here * }
  70.   NT_EXTENDED     = 255;
  71.  
  72. {
  73.     This file defines Exec system lists, which are used to link
  74.     various things.  Exec provides several routines to handle list
  75.     processing (defined at the bottom of this file), so you can
  76.     use these routines to save yourself the trouble of writing a list
  77.     package.
  78. }
  79.  
  80.  
  81. Type
  82.  
  83. { normal, full featured list }
  84.  
  85.     pList = ^tList;
  86.     tList = Packed record
  87.     lh_Head     : pNode;
  88.     lh_Tail     : pNode;
  89.     lh_TailPred : pNode;
  90.     lh_Type     : Byte;
  91.     l_pad       : Byte;
  92.     end;
  93.  
  94. { minimum list -- no type checking possible }
  95.  
  96.     pMinList = ^tMinList;
  97.     tMinList = Packed record
  98.     mlh_Head        : pMinNode;
  99.     mlh_Tail        : pMinNode;
  100.     mlh_TailPred    : pMinNode;
  101.     end;
  102.  
  103.  
  104.  
  105. { ********************************************************************
  106. *
  107. *  Format of the alert error number:
  108. *
  109. *    +-+-------------+----------------+--------------------------------+
  110. *    |D|  SubSysId   |  General Error |    SubSystem Specific Error    |
  111. *    +-+-------------+----------------+--------------------------------+
  112. *     1    7 bits          8 bits                  16 bits
  113. *
  114. *                    D:  DeadEnd alert
  115. *             SubSysId:  indicates ROM subsystem number.
  116. *        General Error:  roughly indicates what the error was
  117. *       Specific Error:  indicates more detail
  118. *********************************************************************}
  119.  
  120. const
  121. {*********************************************************************
  122. *
  123. *  Hardware/CPU specific alerts:  They may show without the 8 at the
  124. *  front of the number.  These are CPU/68000 specific.  See 68$0
  125. *  programmer's manuals for more details.
  126. *
  127. *********************************************************************}
  128.     ACPU_BusErr     = $80000002;      { Hardware bus fault/access error }
  129.     ACPU_AddressErr = $80000003;      { Illegal address access (ie: odd) }
  130.     ACPU_InstErr    = $80000004;      { Illegal instruction }
  131.     ACPU_DivZero    = $80000005;      { Divide by zero }
  132.     ACPU_CHK        = $80000006;      { Check instruction error }
  133.     ACPU_TRAPV      = $80000007;      { TrapV instruction error }
  134.     ACPU_PrivErr    = $80000008;      { Privilege violation error }
  135.     ACPU_Trace      = $80000009;      { Trace error }
  136.     ACPU_LineA      = $8000000A;      { Line 1010 Emulator error }
  137.     ACPU_LineF      = $8000000B;      { Line 1111 Emulator error }
  138.     ACPU_Format     = $8000000E;      { Stack frame format error }
  139.     ACPU_Spurious   = $80000018;      { Spurious interrupt error }
  140.     ACPU_AutoVec1   = $80000019;      { AutoVector Level 1 interrupt error }
  141.     ACPU_AutoVec2   = $8000001A;      { AutoVector Level 2 interrupt error }
  142.     ACPU_AutoVec3   = $8000001B;      { AutoVector Level 3 interrupt error }
  143.     ACPU_AutoVec4   = $8000001C;      { AutoVector Level 4 interrupt error }
  144.     ACPU_AutoVec5   = $8000001D;      { AutoVector Level 5 interrupt error }
  145.     ACPU_AutoVec6   = $8000001E;      { AutoVector Level 6 interrupt error }
  146.     ACPU_AutoVec7   = $8000001F;      { AutoVector Level 7 interrupt error }
  147.  
  148.  
  149. { ********************************************************************
  150. *
  151. *  General Alerts
  152. *
  153. *  For example: timer.device cannot open math.library would be $05038015
  154. *
  155. *       Alert(AN_TimerDev|AG_OpenLib|AO_MathLib);
  156. *
  157. ********************************************************************}
  158.  
  159.  
  160. CONST
  161.  
  162. { ------ alert types }
  163.   AT_DeadEnd    = $80000000;
  164.   AT_Recovery   = $00000000;
  165.  
  166.  
  167. { ------ general purpose alert codes }
  168.   AG_NoMemory   = $00010000;
  169.   AG_MakeLib    = $00020000;
  170.   AG_OpenLib    = $00030000;
  171.   AG_OpenDev    = $00040000;
  172.   AG_OpenRes    = $00050000;
  173.   AG_IOError    = $00060000;
  174.   AG_NoSignal   = $00070000;
  175.   AG_BadParm    = $00080000;
  176.   AG_CloseLib   = $00090000;    { usually too many closes }
  177.   AG_CloseDev   = $000A0000;    { or a mismatched close }
  178.   AG_ProcCreate = $000B0000;    { Process creation failed }
  179.  
  180.  
  181. { ------ alert objects: }
  182.   AO_ExecLib      = $00008001;
  183.   AO_GraphicsLib  = $00008002;
  184.   AO_LayersLib    = $00008003;
  185.   AO_Intuition    = $00008004;
  186.   AO_MathLib      = $00008005;
  187.   AO_DOSLib       = $00008007;
  188.   AO_RAMLib       = $00008008;
  189.   AO_IconLib      = $00008009;
  190.   AO_ExpansionLib = $0000800A;
  191.   AO_DiskfontLib  = $0000800B;
  192.   AO_UtilityLib   = $0000800C;
  193.   AO_KeyMapLib    = $0000800D;
  194.  
  195.   AO_AudioDev     = $00008010;
  196.   AO_ConsoleDev   = $00008011;
  197.   AO_GamePortDev  = $00008012;
  198.   AO_KeyboardDev  = $00008013;
  199.   AO_TrackDiskDev = $00008014;
  200.   AO_TimerDev     = $00008015;
  201.  
  202.   AO_CIARsrc    = $00008020;
  203.   AO_DiskRsrc   = $00008021;
  204.   AO_MiscRsrc   = $00008022;
  205.  
  206.   AO_BootStrap  = $00008030;
  207.   AO_Workbench  = $00008031;
  208.   AO_DiskCopy   = $00008032;
  209.   AO_GadTools   = $00008033;
  210.   AO_Unknown    = $00008035;
  211.  
  212.  
  213.  
  214. { ********************************************************************
  215. *
  216. *   Specific Alerts:
  217. *
  218. ********************************************************************}
  219.  
  220. { ------ exec.library }
  221.  
  222.   AN_ExecLib    = $01000000;
  223.   AN_ExcptVect  = $01000001; {  68000 exception vector checksum (obs.) }
  224.   AN_BaseChkSum = $01000002; {  Execbase checksum (obs.) }
  225.   AN_LibChkSum  = $01000003; {  Library checksum failure }
  226.  
  227.   AN_MemCorrupt = $81000005; {  Corrupt memory list detected in FreeMem }
  228.   AN_IntrMem    = $81000006; {  No memory for interrupt servers }
  229.   AN_InitAPtr   = $01000007; {  InitStruct() of an APTR source (obs.) }
  230.   AN_SemCorrupt = $01000008; {  A semaphore is in an illegal state
  231.                                       at ReleaseSempahore() }
  232.   AN_FreeTwice    = $01000009; {  Freeing memory already freed }
  233.   AN_BogusExcpt   = $8100000A; {  illegal 68k exception taken (obs.) }
  234.   AN_IOUsedTwice  = $0100000B; {  Attempt to reuse active IORequest }
  235.   AN_MemoryInsane = $0100000C; {  Sanity check on memory list failed
  236.                                       during AvailMem(MEMF_LARGEST) }
  237.   AN_IOAfterClose = $0100000D; {  IO attempted on closed IORequest }
  238.   AN_StackProbe   = $0100000E; {  Stack appears to extend out of range }
  239.   AN_BadFreeAddr  = $0100000F; {  Memory header not located. [ Usually an
  240.                                   invalid address passed to FreeMem() ] }
  241.   AN_BadSemaphore = $01000010; { An attempt was made to use the old
  242.                                       message semaphores. }
  243.  
  244. { ------ graphics.library }
  245.  
  246.   AN_GraphicsLib  = $02000000;
  247.   AN_GfxNoMem     = $82010000;  {  graphics out of memory }
  248.   AN_GfxNoMemMspc = $82010001;